

diary 'flyfly.txt'
diary on;

X = 0:1000:50000;
Y = 0:1000:70000;
aa = length(X);
b = length(Y);
t= 0:1:360;
map =zeros(aa,b,2);
V1=82.5;
V2=100;
a=0.95;
L1=4000;
plan=zeros(1,7*5);
M=70000;
%% 开始循环过程
for i=1:aa
    for j=1:b
        kk=0;%%%从第一种开始
        panduan=0;
        for V1 =80:0.5:82
            for V2=95:1:101
                kk=kk+1;
                for a=0.85:0.05:1
                    [t,xxyy] = ode45( @(t,y)fly_the_air(t,y,L1,V1,V2,a,M),t,[X(i),Y(j),50000,50000,50000,20000]);
                    [status ,tt] = check_status(xxyy,M);
                    
                    %  status 的状态
                    %  0 - 未知
                    % 1 - 拦截成功
                    % -1  ： 曲率不满足条件
                    % 2 ： 突围成功
                    
                    if status ==2
                        map(i,j,1)= map(i,j,1)+1;
                        panduan=1;
                        %     if(t>357)%恰好的情况
                        %          map(i,j,2)= map(i,j,2)+1;
                        %          disp("-----!!!!!!!!-----");
                        %     end
                    end
                end
                if(panduan==1)
                    plan(kk)=plan(kk)+1;
                end
            end
        end
        if(panduan==1)
            disp(i)
            disp(j)
            disp("----")
        end
    end
end
diary off;
load('Q1.mat');